home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3222 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Standard in C++ missing from C?????
  5. Date: Fri, 26 Jan 96 23:52:34 GMT
  6. Organization: none
  7. Message-ID: <822700354snz@genesis.demon.co.uk>
  8. References: <4eb1dm$ogl@lunar.eclipse.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4eb1dm$ogl@lunar.eclipse.net> meritech@eclipse.net  writes:
  15.  
  16. >Does C++ have a standard written for the definition of :
  17. >
  18. >p = p++;
  19.  
  20. The place to ask questions about C++ is comp.lang.c++.
  21.  
  22. >My boss asked me, and I have no clue.  I know that C basically says that this
  23. >is undefined and should NOT be used in a real program.  And I know the debate
  24. >that rages on and on.  BUT, does C++ have this same problem???
  25.  
  26. What problem? That expression simply doesn't mean anything. If you meant
  27. p = p+1 or p++ then write just that. 
  28.  
  29. >My compiler doesn't complain, but then, that doesn't supprise me either.
  30.  
  31. The expression has undefined behaviour (in C and C++) but the compiler
  32. isn't required to warn about it. In it's general form this situation can't
  33. be detected at compile time.
  34.  
  35. -- 
  36. -----------------------------------------
  37. Lawrence Kirby | fred@genesis.demon.co.uk
  38. Wilts, England | 70734.126@compuserve.com
  39. -----------------------------------------
  40.